Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

first(0, X) → nil
first(s(X), cons(Y, Z)) → cons(Y, n__first(X, activate(Z)))
from(X) → cons(X, n__from(s(X)))
first(X1, X2) → n__first(X1, X2)
from(X) → n__from(X)
activate(n__first(X1, X2)) → first(X1, X2)
activate(n__from(X)) → from(X)
activate(X) → X

Q is empty.

We use [23] with the following order to prove termination.

Recursive path order with status [2].
Quasi-Precedence:
[first2, 0, nil, activate1] > nfirst2 > [s1, cons2, nfrom1]
[first2, 0, nil, activate1] > from1 > [s1, cons2, nfrom1]

Status:
from1: multiset
first2: [2,1]
nfrom1: multiset
0: multiset
s1: multiset
nil: multiset
cons2: [1,2]
nfirst2: multiset
activate1: [1]